package net.lzzy.mybatis.mapper;

import org.apache.ibatis.annotations.*;
import net.lzzy.mybatis.entity.comment;

@Mapper
public interface CommentMapper {
    //通过id查询评论
    @Select("SELECT * FROM t_comment WHERE id=#{id}")
    public comment findById(Integer id);

    @Insert("INSERT INTO t_comment(content,author,a_id) "+"VALUES (#{content},#{author},#{aId})")
    public int insertComment(comment comment);

    @Update("UPDATE t_comment SET content=#{content} WHERE id=#{id}")
    public int updateComment(comment comment);

    @Delete("DELETE FROM t_comment WHERE id=#{id}")
    public int deleteComment(Integer id);


}
